package com.hyk.learning.test.client;

import com.hyk.learning.config.RpcServiceConfig;
import com.hyk.learning.proxy.RpcClientProxy;
import com.hyk.learning.remoting.transport.RpcRequestTransport;
import com.hyk.learning.remoting.transport.socket.SocketRpcClient;
import com.hyk.learning.test.helloApi.Hello;
import com.hyk.learning.test.helloApi.HelloService;

/**
 * @className: SocketClientMain
 * @author: hyk199710
 * @description: TODO
 * @date: 2024/5/21 23:04
 */
public class SocketClientMain {

    public static void main(String[] args) {
        RpcRequestTransport rpcRequestTransport = new SocketRpcClient();
        RpcServiceConfig rpcServiceConfig = new RpcServiceConfig();
        RpcClientProxy rpcClientProxy = new RpcClientProxy(rpcRequestTransport, rpcServiceConfig);
        HelloService helloService = rpcClientProxy.getProxy(HelloService.class);
        String hello = helloService.hello(new Hello("111", "222"));
        System.out.println(hello);
    }
}
